package com.ruoyi.merchant.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * 订单评价对象 order_reviews
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class OrderReview extends BaseEntity {
    
    private static final long serialVersionUID = 1L;

//    @ApiModelProperty("评价ID")
    private Long reviewId;

    @NotNull(message = "订单ID不能为空")
//    @ApiModelProperty("订单ID")
    private Long orderId;

//    @ApiModelProperty("用户ID")
    private Long customerId;

//    @ApiModelProperty("商家ID")
    private Long merchantId;

//    @NotNull(message = "评分不能为空")
    @Min(value = 1, message = "评分最低为1分")
    @Max(value = 5, message = "评分最高为5分")
    @Excel(name = "评分")
//    @ApiModelProperty("评分：1-5分")
    private Integer score;

    @Excel(name = "评价内容")
//    @ApiModelProperty("评价内容")
    private String content;

//    @ApiModelProperty("图片数组")
    private String images;

    @Excel(name = "是否匿名", readConverterExp = "0=否,1=是")
//    @ApiModelProperty("是否匿名：0-否，1-是")
    private Integer isAnonymous;

    @Excel(name = "商家回复")
//    @ApiModelProperty("商家回复")
    private String replyContent;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @ApiModelProperty("回复时间")
    private Date repliedAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @ApiModelProperty("删除时间")
    private Date deletedAt;

//    @ApiModelProperty("预留字段1")
    private String externField1;

//    @ApiModelProperty("预留字段2")
    private String externField2;

    // ========== 扩展字段（非数据库字段） ==========
    
//    @ApiModelProperty("客户名称")
    private String customerName;
    
//    @ApiModelProperty("客户头像")
    private String customerAvatar;
    
//    @ApiModelProperty("订单编号")
    private String orderNo;
    
//    @ApiModelProperty("图片列表")
    private List<String> imageList;
    
//    @ApiModelProperty("是否已回复")
    private Boolean replied;

    /**
     * 查询条件：回复状态筛选
     * 非数据库字段，仅用于查询
     */
    private Boolean repliedFilter;
}
